﻿//Copyright (c) Chris Pietschmann 2013 (http://pietschsoft.com)
//Licensed under the GNU Library General Public License (LGPL)
//License can be found here: http://easypatterns.codeplex.com/license

namespace EasyPatterns.Factory
{
    /// <summary>
    /// A SimpleFactory for creating instances of the specified Type.
    /// </summary>
    /// <typeparam name="T">The Type the factory will create. Must declare a parameterless constructor.</typeparam>
    public class SimpleFactory<T> : Factory<T, T>
        where T : new()
    {
        /// <summary>
        /// Creates a new instance of the specified Type.
        /// </summary>
        /// <returns>An instnace of the specified Type.</returns>
        protected override T CreateInstance()
        {
            return new T();
        }
    }
}
